<?php foreach ($fun as $key=>$vaule){ ?>
<ul class="sidebar-menu ">
    <li class="treeview <?php if(isset($active)&&$active==$key){echo 'active';}?>">
        <a href="<?php if(isset($vaule['url'])){echo  url($vaule['url']);}else{echo '#';}?>">
            <i class="fa  fa-list"></i>
            <span><?php echo $key;?></span>
            <?php if(!isset($vaule['url'])){ ?><i class="fa fa-angle-left pull-right"></i> <?php } ?>
        </a>
        <?php if(!isset($vaule['url'])){ ?>
            <ul class="treeview-menu">
                <?php foreach ($vaule as $k=>$v){ ?>
                    <li><a href="<?php echo url($v['suburl']);?>"><i class="fa  fa-tags"></i><?php echo $v['subname'];?></a></li>
                <?php } ?>
            </ul>
        <?php } ?>
    </li>
</ul>
<?php }?>
